package com.itany.nmms.service;

import com.github.pagehelper.PageInfo;
import com.itany.nmms.entity.Product;
import com.itany.nmms.exception.FileUploadErrorException;
import com.itany.nmms.exception.ProductExistException;
import com.itany.nmms.exception.ProductTypeExistException;
import com.itany.nmms.exception.RequestParameterErrorException;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpSession;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public interface ProductService {

void addProduct(String name, String price, String description, CommonsMultipartFile file, String typeId, HttpSession session) throws RequestParameterErrorException, ProductTypeExistException, FileUploadErrorException;
PageInfo<Product> findPage(String pageNo,String pageSize);
Product findById(String id) throws RequestParameterErrorException;
void modifyProduct(String id,String name, String price, String description, CommonsMultipartFile file, String typeId, HttpSession session) throws RequestParameterErrorException, ProductExistException, FileUploadErrorException;
void deleteById(String id,HttpSession session) throws RequestParameterErrorException;
}
